<template>
	<view>
		<ttBar title="门店课表详情" leftIcon="icon-back"></ttBar>
		<text class="date">日期：{{classInfo.tapDate}}</text>
		<view class="dtBox">
			<view class="row">
				<text class="iconfont icon-banji" style="font-size: ;"></text>
				<text>班级：{{classInfo.className}}</text>
			</view>
			<view class="row">
				<text class="iconfont icon-shijian"></text>
				<text>时间：{{classInfo.classTime}}</text>
			</view>
			<view class="row">
				<text class="iconfont icon-blackboard"></text>
				<text>教室：{{classInfo.classRoom}}</text>
			</view>
			<view class="row">
				<text class="iconfont icon-geren1"></text>
				<text>老师：{{classInfo.tNames}}</text>
			</view>
			<view class="row">
				<text class="iconfont icon-wufengxian"></text>
				<text>状态：{{isRoll?'已上课':'未上课'}}</text>
			</view>
			<view class="row">
				<text class="iconfont icon-xiangqing"></text>
				<text>课程：{{classInfo.courseName}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import API from '@/common/api.js';
	import ttBar from "../../components/ttBar/ttBar.vue";
	export default {
		components:{
			ttBar
		},
		data() {
			return {
				classInfo:{},
				isRoll:false,
			};
		},
		methods:{
			getData(){
				API.apiGetGetRollCallStatus({
					begin:this.classInfo.tapDate
				}).then(res=>{
					console.log(res);
					if(res.data.data.length){
						res.data.data.forEach((m,n)=>{
							if(m.begin==this.classInfo.begin&&m.end==this.classInfo.end&&m.class_id==this.classInfo.classId&&m.timetableId==this.classInfo.id){
								this.isRoll=true;
								return false;
							}
						})
					}else{
						this.isRoll=false;
					}
					
				})
			}
		},
		onLoad() {
			this.classInfo=uni.getStorageSync('tbDt');
			this.getData()
		}
	}
</script>

<style lang="less">
page{
	background-color: #f6f6f6;
}
.date{
	border-top: 1px solid #f0f0f0;
	height: 90upx;
	line-height: 90upx;
	background-color: #FFFFFF;
	font-size: 32upx;
	display: block;
	width: 100%;
	padding:0 60upx ;
}
.dtBox{
	display: flex;
	flex-direction: column;
	background-color: #FFFFFF;
	border-radius: 20upx;
	margin: 18upx;
	padding: 30upx 42upx;
	.row{
		display: flex;
		align-items: center;
		font-size: 28upx;
		margin-bottom: 16upx;
		.iconfont{
			color: #ffbe33;
			font-size: 32upx;
			margin-right: 10upx;
		}
	}
}
</style>
